package interfaz.admin;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;

import BaseDeDatos.ConsultasUsuario;
import ClasesBasicas.Usuario;

public class PanelModificar extends JPanel{
	
	// Variables declaration - do not modify
	private javax.swing.JButton bAtras;
	private javax.swing.JButton bCrear;
	private javax.swing.JLabel lEmail;
	private javax.swing.JLabel lId;
	private javax.swing.JLabel lNombre;
	private javax.swing.JLabel lPsw;
	private javax.swing.JLabel lTlf;
	private javax.swing.JTextField tfEmail;
	private javax.swing.JTextField tfId;
	private javax.swing.JTextField tfNombre;
	private javax.swing.JTextField tfPsw;
	private javax.swing.JTextField tfTlf;
	private PanelInicialAdmin panelInicialAdmin;
	private PanelConexionesAdmin panelconexionesAdmin;
	private JLabel fondo;
	// End of variables declaration

	/**
	 * Creates new form PanelCrearUsuario
	 */
	public PanelModificar(PanelInicialAdmin pI, PanelConexionesAdmin pC) {

		panelconexionesAdmin = pC;
		panelInicialAdmin = pI;
		lId = new javax.swing.JLabel();
		lNombre = new javax.swing.JLabel();
		lPsw = new javax.swing.JLabel();
		lTlf = new javax.swing.JLabel();
		lEmail = new javax.swing.JLabel();
		tfId = new javax.swing.JTextField();
		tfNombre = new javax.swing.JTextField();
		tfPsw = new javax.swing.JTextField();
		tfTlf = new javax.swing.JTextField();
		tfEmail = new javax.swing.JTextField();
		bCrear = new javax.swing.JButton();
		bAtras = new javax.swing.JButton();
		fondo = new JLabel();

		setLayout(null);

		lId.setText("Id usuario");
		lId.setForeground(new java.awt.Color(255, 255, 255));
		add(lId);
		lId.setBounds(220, 100, 100, 30);

		lNombre.setText("Nombre");
		lNombre.setForeground(new java.awt.Color(255, 255, 255));
		add(lNombre);
		lNombre.setBounds(220, 150, 100, 30);

		lPsw.setText("Password");
		lPsw.setForeground(new java.awt.Color(255, 255, 255));
		add(lPsw);
		lPsw.setBounds(220, 210, 100, 30);

		lTlf.setText("Telefono");
		lTlf.setForeground(new java.awt.Color(255, 255, 255));
		add(lTlf);
		lTlf.setBounds(220, 270, 100, 30);

		lEmail.setText("Email");
		lEmail.setForeground(new java.awt.Color(255, 255, 255));
		add(lEmail);
		lEmail.setBounds(220, 330, 100, 30);
		add(tfId);
		tfId.setBounds(320, 100, 160, 30);
		add(tfNombre);
		tfNombre.setBounds(320, 150, 160, 30);
		add(tfPsw);
		tfPsw.setBounds(320, 210, 160, 30);
		add(tfTlf);
		tfTlf.setBounds(320, 270, 160, 30);
		add(tfEmail);
		tfEmail.setBounds(320, 330, 160, 30);

		bCrear.setText("Editar");
		bCrear.addMouseListener(new MouseListener() {
			public void mouseClicked(MouseEvent evt) {

			}

			public void mouseEntered(MouseEvent arg0) {

			}

			public void mouseExited(MouseEvent arg0) {

			}

			public void mousePressed(MouseEvent arg0) {	   }

			public void mouseReleased(MouseEvent arg0) {	}
		});
		add(bCrear);
		bCrear.setBounds(350, 410, 80, 30);

		bAtras.setText("Atras");
		bAtras.addMouseListener(new MouseListener() {
			public void mouseClicked(MouseEvent evt) {
				atras(evt);
			}

			public void mouseEntered(MouseEvent arg0) {

			}

			public void mouseExited(MouseEvent arg0) {

			}

			public void mousePressed(MouseEvent arg0) {	   }

			public void mouseReleased(MouseEvent arg0) {	}
		});
		add(bAtras);
		bAtras.setBounds(90, 500, 70, 30);

		fondo.setIcon(new ImageIcon("src/resources/fondoAdmin.jpg"));
		add(fondo);
		fondo.setBounds(0, 0, 800, 600);

	}// </editor-fold>

	private void atras(MouseEvent evt) {
		this.setVisible(false);
		panelInicialAdmin.ventanaAdmin.getContentPane().add(panelconexionesAdmin, 0);
		panelconexionesAdmin.setVisible(true);
	}




}

